import {CarService} from "../CarService";
import { Service, Inject } from "typedi";
import { CarDao } from "../../dao/CarDao";

@Service()
export class CarServiceImpl implements CarService {
	
	@Inject()
	private carDao:CarDao;
	
	public async addCar(userid: string, courseId: string): Promise<Object> {
		return await this.carDao.addCarList(userid,courseId);
	}
	
	public async getCarList (userid: string, OrderNumber: number): Promise<Array<Object>> {
	  return await this.carDao.getCarList(userid, OrderNumber);
	}
	
	public async updateOrder(orderNumber: number, userid: string): Promise<Object> {
		return await this.carDao.updateOrderStatus(orderNumber, userid);
	}
	
	public async deleteCar(userid: string, courseid: string): Promise<Object> {
		return await this.carDao.deleteCar(userid, courseid);
	}
	
	public async getCarPayList(userid: string): Promise<Object> {
		return await this.carDao.getCarPayList(userid)
	}
}